apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
  name: cilium-gateway
  namespace: default
spec:
  gatewayClassName: cilium
  listeners:
  - hostname: hipstershop.cilium.rocks
    name: hipstershop-cilium-rocks-http
    port: 80
    protocol: HTTP
  - hostname: hipstershop.cilium.rocks
    name: hipstershop-cilium-rocks-https
    port: 443
    protocol: HTTPS
    tls:
      certificateRefs:
      - kind: Secret
        name: demo-cert
  - hostname: bookinfo.cilium.rocks
    name: bookinfo-cilium-rocks-http
    port: 80
    protocol: HTTP
  - hostname: bookinfo.cilium.rocks
    name: bookinfo-cilium-rocks-https
    port: 443
    protocol: HTTPS
    tls:
      certificateRefs:
      - kind: Secret
        name: demo-cert
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: hipstershop-cilium-rocks
  namespace: default
spec:
  hostnames:
  - hipstershop.cilium.rocks
  parentRefs:
  - name: cilium-gateway
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /hipstershop.ProductCatalogService
    backendRefs:
    - name: productcatalogservice
      port: 3550
  - matches:
    - path:
        type: PathPrefix
        value: /hipstershop.CurrencyService
    backendRefs:
    - name: currencyservice
      port: 7000
      
---
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
  name: bookinfo-cilium-rocks
  namespace: default
spec:
  hostnames:
  - bookinfo.cilium.rocks
  parentRefs:
  - name: cilium-gateway
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /details
    backendRefs:
    - name: details
      port: 9080
  - matches:
    - path:
        type: PathPrefix
        value: /
    backendRefs:
    - name: productpage
      port: 9080
